var gulp = require('gulp');
var runSequence = require('run-sequence');
var del = require('del');
var clean = require('gulp-clean')
var config = require('../config').des;

gulp.task('del', function(cb) {
    del([config.dest + '/', config.rev + '/'], cb)
});

gulp.task('clean', function() {
    return gulp.src([config.dest + '/', config.rev + '/'], {read: false})
        .pipe(clean())
});

gulp.task('dev', ['clean'], function(cb) {
    cb = cb || function() {};
    global.isProd = false;
    runSequence(
      ['copy', 'font', 'fontimg', 'images'],
      ['scripts'],
      ['less'],
      ['html'],
      'connect', 'watch',
     cb);
});
